package com.smart.common.config.satoken;

import cn.dev33.satoken.config.SaTokenConfig;
import cn.dev33.satoken.stp.StpUtil;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.utils.MemberStp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
 * @author Administrator
 */
@Configuration
public class SaTokenConfigure {

    @Bean
    @Primary
    public SaTokenConfig getSaTokenConfigPrimary() {
        SaTokenConfig config1 = new SaTokenConfig();
        config1.setTokenName(SmartConstant.TOKEN_NAME);
        config1.setTimeout(2592000);
        config1.setIsPrint(false);
        //15分钟内没人操作 令牌自动失效
        config1.setActiveTimeout(60 * 15);
        config1.setIsConcurrent(false);
        config1.setTokenStyle("uuid");
        config1.setTokenPrefix("Bearer");
        config1.setIsLog(false);
        return config1;
    }


}
